/* filestore */
var filestore = require('ringo/storage/filestore');
var storePath = './db';
var store = new filestore.Store(storePath);

/* h2db */
// var {Store} = require("ringo-sqlstore");
// var store = new Store({
// "url": "jdbc:h2:mem:test",
// "driver": "org.h2.Driver"
// });

exports.Post = store.defineEntity('Post');
exports.Comment = store.defineEntity('Comment');

var dates = require('ringo/utils/dates');
exports.Post.prototype.toString = function() {
	return '[Post: ' + this.title+'(' 
		+ this.author + ',' + dates.format(this.createtime,'yyyy.MM.dd HH:mm:ss') + ')]';
};
